/*
 * @描述 自定义状态栏控件
 * @作用 声明自定义状态栏类titleBar
 * @创作者 wsgalaxy<wsgalaxy@163.com>
 * @创建时间 2017-5-9
 */


#ifndef TITLEBAR_H
#define TITLEBAR_H

#include <QWidget>
#include <QMouseEvent>

class titleBar : public QWidget
{
    Q_OBJECT
private:
    int wherePointing;      //鼠标位置
    int isMousePressed;     //鼠标是否已按下
    QPoint lastPoint;       //鼠标上一个点按下的位置
public:
    explicit titleBar(QWidget *parent = 0);

signals:
    void closeWindows();                    //关闭按钮被按下时发出
    void miniWindows();                     //最小化按钮被按下时发出
    void moveWindows(QMouseEvent* event);   //移动窗口时发出
    void titlePressed(QMouseEvent* event);  //标题被按下时发出

public slots:
    void paintEvent(QPaintEvent* event);
    void mousePressEvent(QMouseEvent* event);
    void mouseReleaseEvent(QMouseEvent* event);
    void mouseMoveEvent(QMouseEvent* event);
    void enterEvent(QEvent* event);
    void leaveEvent(QEvent* event);
};

#endif // TITLEBAR_H
